package com.eesujie.xcs.service.impl;

import com.eesujie.xcs.entity.po.NoteImagePO;
import com.eesujie.xcs.mapper.NoteImageMapper;
import com.eesujie.xcs.service.NoteImageService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 笔记图片表 服务实现类
 * </p>
 *
 * @author eesujie
 * @since 2023-04-19
 */
@Service
public class NoteImageServiceImpl extends ServiceImpl<NoteImageMapper, NoteImagePO> implements NoteImageService {

    @Override
    public List<String> getImagesByNoteId(long noteId) {

        return lambdaQuery()
                .eq(NoteImagePO::getNoteId, noteId)
                .list().stream().map(NoteImagePO::getImage).toList();
    }

}
